home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
codecs
/
developer
/
codecs_library.readme
< prev
Wrap
Text File
|
1999-09-16
|
5KB
|
131 lines
This is a second beta realease of the codecs.library.
INTRODUCTION
============
I created a system for managing compression codecs. Amiga has no such thing,
though there is the excellent XPK system. Codecs are much like XPK sublibraries
but a codec are not stream oriented, they can have knowledge about the data
they compress. For image codecs this is very important. You can not code
an image well if you have no idea about what you are coding. JPEG is a good
example to illustrate this. It maps images from RGB to YUV colorspace and
uses DCT on the image data. To do this it must know some properties of the
image, such a s height and width. The codec 'knows' about the image it
compresses. This is not possible with XPK sublibraries.
Therefor, I created another system. It has become the codecs.library, it is a
library just like datatypes.library but manages codecs. And I have created a
first codec: The sp.codec that implements the s+p wavelet compression with
huffman coding.
The current software consists of the Codecs.library that has 4 function:
- NewCodec
- DisposeCodec
- Encode
- Decode
In this release there is one codec; the sp.codec. This codec will rougly about
halve the size of an image. It codec lossless, e.g. you get exactly back the
image you put in. And therefor it does not compress as well as the lossy JPEG.
Work is in progress to also provide lossy coding for the sp.codec. Then a
slider from 1%-100% will determine how much imagedata will be trown away 1%
meaning a lot, 100% meaning nothing (lossless)
All is very BETA at this time, there are thing to fix. But I released this
code to see if (and how) people react to it.
(So keep in mind, this code is SLOW and BUGGY I know!)
DEVELOPERS
==========
You can always contact me for questions. If you want to create your own codecs,
contact me! Use this software to experiment only, do not make any release
containing this software, contact me first. Newer versions are not guaranteed
to be compatible.
Peek in the source to see how the interface works in detail.
The big picture is:
open the codecs lib:
OpenLibrary("codecs.library", 0);
now you can create codecs, here is how to create a sp.codec object:
MyCodec = NewCodec("sp.codec", 0);
now it is possible to Encode() / Decode() with the created codec object, (a
TagList is used)
Encode(MyCodec, ...) / Decode(MyCodec, ...)
when done, dispose of the codec:
DisposeCodec(MyCodec)
when not used anymore, you can close the codecs library
CloseLibrary();
Note that you never deal with the codec itself, you always use calls in the
codecs.library.
I included a sample application and source to show how the library and
codecs can be used. This release also has some documenation with it.
The IffCompress program used the codecs.library and can be recompiled with
SAS/C v6.58. The lena.ilbm standard test image is included for testing it.
usage: IffCompress <src image> <dst image>
When src image is byterun1 compressed it will produce a sp.codec compressed
dst-image and vice-versa.
The program used the byterun.codec to perform the byterun en/decoding and
read/writes images with an experimental codec that has far better compression.
Both codecs are lossless.
You will see that the codecs.library has nothing to do with fileformats etc it
just compresses data images and sound. The program compresses the image and
writes the compressed data out 1:1 in a BODY chunk.
HISTORY
=======
14-02-1999 v0.1 First public beta release
07-04-1999 v0.2 Second release, added developer docs and a byterun.codec
restructured the internals of the codecs.library
TODO
====
- Fibonacci (sound), IFF-ANIM, ZLIB and many others these are small simple
codecs and by increasing the number of available codecs I hope to increase
its value for developers.
- Add Get/SetCodecAttr() to codecs.library to set parameters for codecs
- Provide SDK for codecs to developers, for now contact me if you want to
develop your own codec.
- Improve sp.codec to handle more source/destination types.
- Add arithmentic coding to sp.codec and improve coding ration by 10%
(this is almost done, but I'm not content with the speed yet!)
- Add quantization to sp.codec to implement 'lossy' coding (and beat JPEG!)
- Create good codec for palette images (and beat GIF/PNG with it)
LEGAL
=====
All provided software is freely usable but copyrighted by me and you use all
this at your own risk.
Example:
IffCompress lena.ilbm lena.sp
Lena.ilbm is 243 KB
Lena.sp is 156 KB
====================================================================
Regards,
Marcel de Wit
marcel@technolution.nl